package com.centanet.framework.rx;

import com.centanet.framework.utils.FolderUtil;

import java.io.File;

import rx.Observable;
import rx.Subscriber;

/**
 * 文件夹大小
 * Created by guilin on 16/1/12.
 */
final class FolderSizeOnSubcribe implements Observable.OnSubscribe<String> {

    private final File file;

    public FolderSizeOnSubcribe(File file) {
        this.file = file;
    }

    @Override
    public void call(Subscriber<? super String> subscriber) {
        subscriber.onNext(FolderUtil.getImageCachSize(file));
        subscriber.onCompleted();
    }

}
